package homework.billing.meter.simple;

import homework.billing.meter.Meter;

public class PrePaidMeter implements Meter {

    private float unit;
    private float price;

    public PrePaidMeter(float unit, float price) {
        this.unit = unit;
        this.price = price;
    }

    @Override
    public double cost(float param) {
        return Math.ceil(param/unit)*price;
    }

    public static void main(String[] args) {
        PrePaidMeter meter = new PrePaidMeter(60, 1);
        System.out.println(meter.cost(70));
    }
}
